$(document).ready(function () {

    //点击返回
    $(".go-back").click(function () {
        var url = $(this).attr("url");
        console.log(url);
        window.location = url;
    });

    //点击各级达人
    $(".card-list .item").click(function () {
        var url = $(this).attr("url");
        var upgrade_type = $(this).attr("upgrade-type");
        var data_level = $(this).attr("data-level");
        if(upgrade_type>0&&upgrade_type<4 && upgrade_type!=data_level){
            let msg ='存在';
            if(upgrade_type==1){
                msg+='【一星达人】';
            }else if(upgrade_type==2){
                 msg+='【二星达人】';
            }else if(upgrade_type==3){
                
                 msg+='【三星达人】';
            }else{
                  msg+='【其他】';
            }
            msg+="任务未完成！请先完成！"
            
                layer.msg(msg, {icon: 2, time: 3000, shade: 0.4},function(){
                     window.location = "/index/task/upgrade";
                });
                return false;
        }
        console.log(url);
        window.location = url;
    });

});